package com.gzx.plugin.tjzy.modular.inspection.constant;

/**
 * 人工质检
 */
public enum InspectionConstant {

    CUSTOMER_EXCEPTION(0, "客户异常"),
    AGENT_EXCEPTION(1, "坐席异常"),
    NO_EXCEPTION(2, "双方都无异常"),
    BOTH_EXCEPTION(3, "双方都异常");

    private final int code;
    private final String description;

    InspectionConstant(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 根据code获取对应的枚举值
    public static InspectionConstant fromCode(int code) {
        for (InspectionConstant status : InspectionConstant.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid code: " + code);
    }
}
